<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li><a>主页</a></li>
			<li><a>银行家用户管理</a></li>
			<li class="active"><strong>修改用户</strong></li>
		</ol>
	</div>
</div>
<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-controller="updateUserInfoCtrl">
	<form class="form-horizontal" name="horizontal" novalidate>
		<div class="form-group">
			<div class="row">
				<div class="col-lg-12">
					<div class="tabs-container tab_other">
						<uib-tabset>
							<uib-tab> 
								<uib-tab-heading>
									<span class="block m-t-xs"> <i class="fa fa-laptop"></i> <strong
										class="font-bold">基本信息</strong>
									</span> 
								</uib-tab-heading>
								<div class="ibox-title">
									<h5>基本信息</h5>
								</div>
								<div class="panel-body ibox float-e-margins">
									<div class="form-group">
										<label class="col-sm-1 control-label" >所属组织：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.orgName"></p></div>
										<label class="col-sm-1 control-label" >总收益：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.totalProfit"></p></div>
										<label class="col-sm-1 control-label" >用户编号：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.userCode"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label">用户节点：</label>
										<div class="col-sm-2 checkbox" ng-bind="baseInfo.userNode"></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >昵称：</label>
										<div class="col-sm-2">
											<input type="text" class="form-control" name="nickName" ng-model="baseInfo.nickName" >
											<div class="req_mesg" ng-show="horizontal.nickName.$dirty && horizontal.nickName.$invalid">
												<span ng-show="horizontal.nickName.$error.required">昵称不能为空</span>
											</div>
										</div>
										<label class="col-sm-1 control-label" >微信号：</label>
										<div class="col-sm-2">
											<input type="text" class="form-control" name="weixinCode" ng-model="baseInfo.weixinCode">
											<div class="req_mesg" ng-show="horizontal.weixinCode.$dirty && horizontal.weixinCode.$invalid">
												<span ng-show="horizontal.weixinCode.$error.required">微信号不能为空</span>
											</div>
										</div>
										<label class="col-sm-1 control-label" >手机号：</label>
										<div class="col-sm-2">
											<input type="text" class="form-control" name="phone" ng-model="baseInfo.phone">
											<div class="req_mesg" ng-show="horizontal.phone.$dirty && horizontal.phone.$invalid">
												<span ng-show="horizontal.phone.$error.required">手机号不能为空</span>
											</div>
										</div>
										<label class="col-sm-1 control-label" >姓名：</label>
										<div class="col-sm-2">
											<input type="text" class="form-control" name="userName" ng-model="baseInfo.userName">
											<div class="req_mesg" ng-show="horizontal.userName.$dirty && horizontal.userName.$invalid">
												<span ng-show="horizontal.userName.$error.required">姓名不能为空</span>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >代理状态：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.statusAgent"></p></div>
										<label class="col-sm-1 control-label" >身份：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.userType"></p></div>
										<label class="col-sm-1 control-label" >退款状态：</label>
										<div class="col-sm-2">
											<select class="form-control" ng-model="baseInfo.payBack" ng-options="x.value as x.text for x in payBackList">
											</select>
										</div>
										<label class="col-sm-1 control-label" >优秀导师：</label>
										<div class="col-sm-2">
											<select class="form-control" ng-model="baseInfo.statusMentor" ng-options="x.value as x.text for x in statusMentorList">
											</select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >一级ID：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topOneCode"></p></div>
										<label class="col-sm-1 control-label" >一级名称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topOneUserName"></p></div>
										<label class="col-sm-1 control-label" >一级身份：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topOneUserType"></p></div>
										<label class="col-sm-1 control-label" >一级昵称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topOneNiceName"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >二级ID：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topTwoCode"></p></div>
										<label class="col-sm-1 control-label" >二级名称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topTwoUserName"></p></div>
										<label class="col-sm-1 control-label" >二级身份：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topTwoUserType"></p></div>
										<label class="col-sm-1 control-label" >二级昵称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topTwoNiceName"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >三级ID：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topThreeCode"></p></div>
										<label class="col-sm-1 control-label" >三级名称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topThreeUserName"></p></div>
										<label class="col-sm-1 control-label" >三级身份：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topThreeUserType"></p></div>
										<label class="col-sm-1 control-label" >三级昵称：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.topThreeNiceName"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >直接下级代理数量：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.subAgentCount"></p></div>
										<label class="col-sm-1 control-label" >直营用户数量：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.subUserCount"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >入驻时间：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.createDateStr"></p></div>
										<label class="col-sm-1 control-label" >成为专员时间：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.toagentDateStr"></p></div>
										<label class="col-sm-1 control-label" >成为经理时间：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.toBankerDateStr"></p></div>
										<label class="col-sm-1 control-label" >成为银行家时间：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="baseInfo.toManagerDateStr"></p></div>
									</div>


									<div class="form-group">
										<label class="col-sm-1 control-label" >微信头像：</label>
										<div class="col-sm-5 checkbox" >
											<a ng-href="{{baseInfo.userLogoUrl}}" ng-show="baseInfo.userLogoUrl" fancybox rel="group">
												<img width="250px" height="150px" ng-src="{{baseInfo.userLogoUrl}}"/>
											</a>
										</div>
										<label class="col-sm-1 control-label" >微信二维码：</label>
										<div class="col-sm-5 checkbox" >
											<a href="{{baseInfo.qrCodeUrl}}" ng-show="baseInfo.qrCodeUrl" fancybox  rel="group">
												<img width="250px" height="150px" ng-src="{{baseInfo.qrCodeUrl}}"/>
											</a>
										</div>
									</div>
								</div>
								<div class="ibox-title">
									<h5>结算信息</h5>
								</div>
								<div class="panel-body ibox float-e-margins">
									<div class="form-group">
										<label class="col-sm-1 control-label" >姓名：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="userCard.accountName"></p></div>
										<label class="col-sm-1 control-label" >身份证号：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="userCard.accountIdNo"></p></div>
										<label class="col-sm-1 control-label" >手机号：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="userCard.accountPhone"></p></div>
										<label class="col-sm-1 control-label" >银行卡号：</label>
										<div class="col-sm-2 checkbox"><p ng-bind="userCard.cardNo"></p></div>
									</div>
									<div class="form-group">
										<label class="col-sm-9 control-label" ></label>
										<button class="col-sm-1 btn btn-new btn-mr20" ng-show="hasPermit('superBank.updateUserCard')" ng-click="updateCardModal()">修改结算卡</button>
									</div>
									<div class="form-group">
										<label class="col-sm-1 control-label" >银行卡正面：</label>
										<div class="col-sm-5 checkbox">
											<a href="{{baseInfo.positivePhotoUrl}}" ng-show="baseInfo.positivePhotoUrl" fancybox  rel="group">
												<img width="250px" height="150px" ng-src="{{userCard.positivePhotoUrl}}"/>
											</a>
										</div>
									</div>
								</div>
								<div class="ibox-title">
									<h5>收款业务</h5>
								</div>
								<div class="panel-body ibox float-e-margins">
									<div class="form-group">
										<label class="col-sm-1 control-label" >收款状态：</label>
										<div class="col-sm-1 checkbox"><p ng-bind="baseInfo.statusReceive"></p></div>
										<label class="col-sm-1 control-label" ></label>
										<a class="col-sm-1 checkbox" target="_blank" href="#/merchant/queryMerDetail/{{baseInfo.itemId}}">点击跳转</a>
									</div>
								</div>
								<div class="ibox-title">
									<h5>还款业务</h5>
								</div>
								<div class="panel-body ibox float-e-margins">
									<div class="form-group">
										<label class="col-sm-1 control-label" >还款状态：</label>
										<div class="col-sm-1 checkbox"><p ng-bind="baseInfo.statusRepayment"></p></div>
										<label class="col-sm-1 control-label" ></label>
										<a class="col-sm-1 checkbox" target="_blank" href="#/creditRepay/userDetail/{{baseInfo.repaymentUserNo}}">点击跳转</a>
									</div>
								</div>
							</uib-tab>
							<uib-tab>
								<uib-tab-heading>
									<span class="block m-t-xs">
										<i class="fa fa-desktop"></i>
										<strong class="font-bold">账户资料</strong>
									</span>
								</uib-tab-heading>
								<div class="panel-body ibox float-e-margins">
									<div class="ibox-title">
										<h5>账户余额</h5>
									</div>
									<div class="ibox-content">
										<div class="form-group">
											<div class="gridStyle" style="height: 200px;" ui-grid="accountBalances" ui-grid-resize-columns/>
										</div>
									</div>
								</div>
								<div class="panel-body ibox float-e-margins">
									<div class="ibox-title">
										<h5>账户明细</h5>
									</div>
									<div class="panel-body ibox float-e-margins">
										<div class="form-group">
											<label  class="col-sm-1 control-label">操作：</label>
											<div class="col-sm-3">
												<select class="form-control" ng-model="accountInfoRecord.debitCreditSide" ng-options="x.value as x.text for x in debitCreditSideList"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-1 control-label">交易时间：</label>
											<div class="col-sm-6">
												<input id="d5221" class="form-control" type="datetime" ng-model="accountInfoRecord.recordTimeStart"
													   onchange="" style="width:auto;display:inline-block;"
													   onFocus="var d5222=$dp.$('d5222');WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5222.focus();},maxDate:'#F{$dp.$D(\'d5222\')}'})"/>
												~
												<input id="d5222" class="form-control" type="datetime" ng-model="accountInfoRecord.recordTimeEnd"
													   onchange="" style="width:auto;display:inline-block;"
													   onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5221\')}'})"/>
											</div>
										</div>
										<div class="form-group">
											<div class="col-lg-12">
												<label class="col-sm-1 control-label"></label>
												<button class="btn btn-primary6 btn-mr20" type="button" ng-disabled="submitting" ng-click="getUserAccountDetail()">查询</button>
		                                        <button class="btn btn-primary3" type="button" ng-click="clear()">清空</button>
											</div>
										</div>
									<div class="ibox-content">
										<div class="form-group">
											<div class="gridStyle " style="height: 400px;" ui-grid="accountDetail" ui-grid-pagination ui-grid-resize-columns/>
											<div ng-show="loadImg" class="timg"></div>
										</div>
									</div>
								</div>
								</div>
							</uib-tab>
						</uib-tabset>
					</div>
				</div>
			</div>
			<div class="col-lg-12 bgff">
				<div class="col-sm-12">
					<div class="col-sm-2"></div>
					<div class="col-sm-6">
						<div style="padding: 0 15px;">
							<button class="btn btn-primary btn-mr20" ng-disabled="submitBaseInfoStatus" ng-click="submit()"
									type="button">提交</button>
							<button class="btn btn-primary4 btn-mr20" ui-sref="superBank.userManage" type="button">返回</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div style="height:50px"></div>
	</form>
	<div id="updateCardModal" class="modal fade form-horizontal" tabindex="4" role="dialog">
		<div class="modal-dialog" style="height:450px;width: 950px">
			<div class="modal-content" style="height:450px;width: 950px">
				<form class="form-horizontal" name="horizontalCard" novalidate>
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							&times;</button>
						<h3 class="modal-title">修改结算卡</h3>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-2 control-label">新银行卡号：</label>
							<div class="col-sm-3">
								<input type="text" class="form-control" name="cardNo" required
									   ng-blur="getCardInfo(newCard.cardNo)" ng-model="newCard.cardNo">
								<div class="req_mesg" ng-show="horizontalCard.cardNo.$dirty && horizontalCard.cardNo.$invalid">
									<span ng-show="horizontalCard.cardNo.$error.required">银行卡号不能为空</span>
								</div>
								<div class="req_mesg" ng-show="cardMsg!='' && cardMsg!=null ">
									<span>{{cardMsg}}</span>
								</div>
							</div>
							<label class="col-sm-2 control-label">银行名称：</label>
							<div class="col-sm-3">
								<input type="text" class="form-control" readonly ng-model="newCard.bankName">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">手机号：</label>
							<div class="col-sm-3">
								<input type="text" class="form-control" name="accountPhone" required ng-model="newCard.accountPhone">
								<div class="req_mesg" ng-show="horizontalCard.accountPhone.$dirty && horizontalCard.accountPhone.$invalid">
									<span ng-show="horizontalCard.accountPhone.$error.required">手机号不能为空</span>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">开户行地址：</label>
							<div class="col-sm-2">
								<select class="form-control input-s-sm inline" ng-model="newCard.bankProvince" ng-change="getCities()" ng-options="x.name as x.name for x in provinceList"/>
							</div>
							<div class="col-sm-2">
								<select class="form-control input-s-sm inline" name="bankCity" required ng-model="newCard.bankCity" ng-change="getAreas()" ng-blur="getBankList(newCard.bankName,newCard.bankCity)" ng-options="x.name as x.name for x in cityList"/>
							</div>
							<div class="req_mesg" ng-show="horizontalCard.bankCity.$dirty && horizontalCard.bankCity.$invalid">
								<span ng-show="horizontalCard.bankCity.$error.required">地址不能为空</span>
							</div>
							<!--<div class="col-sm-2">
								<select class="form-control input-s-sm inline" ng-model="newCard.bankDistrict" ng-options="x.name as x.name for x in areaList"/>
							</div>-->
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分行：</label>
							<div class="col-sm-4 chosen-mh">
								<select chosen="{width:'100%'}" name="cnapsNo" required id="autocomplete-select" chosen class="chosen-select" tabindex="6" ng-model="newCard.cnaps" ng-options="x as x.bankName for x in bankList">
									<option value=""></option>
								</select>
								<div class="req_mesg" ng-show="horizontalCard.cnapsNo.$dirty && horizontalCard.cnapsNo.$invalid">
									<span ng-show="horizontalCard.cnapsNo.$error.required">支行不能为空</span>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<div class="form-group control-label">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-6">
								<button class="btn btn-primary btn-mr20" type="button" ng-click='updateUserCard()'
								>确定</button>
								<button class="btn btn-primary4" type="button" ng-click='cancel()'
								>返回</button>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>